<script setup lang="ts">
import store from "@/store";
import {onMounted, ref} from "vue";


// const url = import.meta.env.VITE_API_URL as any + "/iframe?token=" + store.userStore.gpsToken
const url = "http://192.168.31.190:5173#/fence?token=" + store.userStore.gpsToken
const iframeRef = ref()

onMounted(()=>{
  console.log(iframeRef.value.contentWindow)
  iframeRef.value.contentWindow.postMessage("你好子页面", '*');
})
</script>

<template>
  <iframe :src="url" id="iframe" ref="iframeRef"></iframe>
</template>

<style scoped>
#iframe{
  border: none;
  width: 100%;
  min-height: calc(100vh - 70px - var(--theme-header-height));
}
</style>
